<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SARibbon: SAColorToolButton类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="SA-logo.png"/></td>
  <td id="projectalign">
   <div id="projectname">SARibbon<span id="projectnumber">&#160;2.4.2</span>
   </div>
   <div id="projectbrief">SARibbon wiki</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('class_s_a_color_tool_button.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-slots">Public 槽</a> &#124;
<a href="#signals">信号</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="#pro-methods">Protected 成员函数</a> &#124;
<a href="class_s_a_color_tool_button-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">SAColorToolButton类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>这是一个只显示颜色的toolbutton  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_s_a_color_tool_button_8h_source.html">SAColorToolButton.h</a>&gt;</code></p>
<div class="dynheader">
类 SAColorToolButton 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_s_a_color_tool_button.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_a_color_tool_button_1_1_private_data.html">PrivateData</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a9e1b41f328cac2030a198fc4509fa344" id="r_a9e1b41f328cac2030a198fc4509fa344"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9e1b41f328cac2030a198fc4509fa344">ColorToolButtonStyle</a> { <a class="el" href="#a9e1b41f328cac2030a198fc4509fa344a9e5a66a1fa852c94de022dc3ffab525a">WithColorMenu</a>
, <a class="el" href="#a9e1b41f328cac2030a198fc4509fa344ab08aec8a63a90bbf26096f84e4abf3fe">NoColorMenu</a>
 }</td></tr>
<tr class="memdesc:a9e1b41f328cac2030a198fc4509fa344"><td class="mdescLeft">&#160;</td><td class="mdescRight">颜色按钮的内置样式  <a href="#a9e1b41f328cac2030a198fc4509fa344">更多...</a><br /></td></tr>
<tr class="separator:a9e1b41f328cac2030a198fc4509fa344"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-slots" name="pub-slots"></a>
Public 槽</h2></td></tr>
<tr class="memitem:af25b39793bb7bab82cd85a44a5da4971" id="r_af25b39793bb7bab82cd85a44a5da4971"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af25b39793bb7bab82cd85a44a5da4971">setColor</a> (const QColor &amp;c)</td></tr>
<tr class="memdesc:af25b39793bb7bab82cd85a44a5da4971"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置颜色  <br /></td></tr>
<tr class="separator:af25b39793bb7bab82cd85a44a5da4971"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="signals" name="signals"></a>
信号</h2></td></tr>
<tr class="memitem:a95ffb60a5732b1bc58a7080c951fcf19" id="r_a95ffb60a5732b1bc58a7080c951fcf19"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a95ffb60a5732b1bc58a7080c951fcf19">colorClicked</a> (const QColor &amp;<a class="el" href="#a22110441cd88842a1e79bf9ad87c5eb9">color</a>, bool checked=false)</td></tr>
<tr class="memdesc:a95ffb60a5732b1bc58a7080c951fcf19"><td class="mdescLeft">&#160;</td><td class="mdescRight">颜色被点击的响应  <br /></td></tr>
<tr class="separator:a95ffb60a5732b1bc58a7080c951fcf19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abcc38455a0be7f57aa389e6f5e388cf2" id="r_abcc38455a0be7f57aa389e6f5e388cf2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abcc38455a0be7f57aa389e6f5e388cf2">colorChanged</a> (const QColor &amp;<a class="el" href="#a22110441cd88842a1e79bf9ad87c5eb9">color</a>)</td></tr>
<tr class="memdesc:abcc38455a0be7f57aa389e6f5e388cf2"><td class="mdescLeft">&#160;</td><td class="mdescRight">颜色改变信号  <br /></td></tr>
<tr class="separator:abcc38455a0be7f57aa389e6f5e388cf2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a5650a43f457764708a9921d4033a4c52" id="r_a5650a43f457764708a9921d4033a4c52"><td class="memItemLeft" align="right" valign="top"><a id="a5650a43f457764708a9921d4033a4c52" name="a5650a43f457764708a9921d4033a4c52"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>SAColorToolButton</b> (QWidget *parent=nullptr)</td></tr>
<tr class="separator:a5650a43f457764708a9921d4033a4c52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a760e6bd7754579d68da4ae1a799126ed" id="r_a760e6bd7754579d68da4ae1a799126ed"><td class="memItemLeft" align="right" valign="top"><a id="a760e6bd7754579d68da4ae1a799126ed" name="a760e6bd7754579d68da4ae1a799126ed"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>SAColorToolButton</b> (<a class="el" href="#a9e1b41f328cac2030a198fc4509fa344">ColorToolButtonStyle</a> style, QWidget *parent=nullptr)</td></tr>
<tr class="separator:a760e6bd7754579d68da4ae1a799126ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22110441cd88842a1e79bf9ad87c5eb9" id="r_a22110441cd88842a1e79bf9ad87c5eb9"><td class="memItemLeft" align="right" valign="top">QColor&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a22110441cd88842a1e79bf9ad87c5eb9">color</a> () const</td></tr>
<tr class="memdesc:a22110441cd88842a1e79bf9ad87c5eb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取颜色  <br /></td></tr>
<tr class="separator:a22110441cd88842a1e79bf9ad87c5eb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e9052dc90f01e96ea99416f8143c7f6" id="r_a6e9052dc90f01e96ea99416f8143c7f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6e9052dc90f01e96ea99416f8143c7f6">setMargins</a> (const QMargins &amp;mg)</td></tr>
<tr class="memdesc:a6e9052dc90f01e96ea99416f8143c7f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置Margins  <br /></td></tr>
<tr class="separator:a6e9052dc90f01e96ea99416f8143c7f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab635c60687be919c9ada5cf3a05b8c31" id="r_ab635c60687be919c9ada5cf3a05b8c31"><td class="memItemLeft" align="right" valign="top"><a id="ab635c60687be919c9ada5cf3a05b8c31" name="ab635c60687be919c9ada5cf3a05b8c31"></a>
QMargins&#160;</td><td class="memItemRight" valign="bottom"><b>margins</b> () const</td></tr>
<tr class="separator:ab635c60687be919c9ada5cf3a05b8c31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f729c5a41bf79744633261745b11533" id="r_a3f729c5a41bf79744633261745b11533"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3f729c5a41bf79744633261745b11533">setColorToolButtonStyle</a> (<a class="el" href="#a9e1b41f328cac2030a198fc4509fa344">ColorToolButtonStyle</a> s)</td></tr>
<tr class="memdesc:a3f729c5a41bf79744633261745b11533"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置颜色按钮的样式  <br /></td></tr>
<tr class="separator:a3f729c5a41bf79744633261745b11533"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb0cf85ca732aa9b2920d463ab6ac943" id="r_aeb0cf85ca732aa9b2920d463ab6ac943"><td class="memItemLeft" align="right" valign="top"><a class="el" href="#a9e1b41f328cac2030a198fc4509fa344">ColorToolButtonStyle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aeb0cf85ca732aa9b2920d463ab6ac943">colorToolButtonStyle</a> () const</td></tr>
<tr class="memdesc:aeb0cf85ca732aa9b2920d463ab6ac943"><td class="mdescLeft">&#160;</td><td class="mdescRight">颜色按钮的样式  <br /></td></tr>
<tr class="separator:aeb0cf85ca732aa9b2920d463ab6ac943"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe7e665431f542893f4a62c3d8604bb0" id="r_afe7e665431f542893f4a62c3d8604bb0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_s_a_color_menu.html">SAColorMenu</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afe7e665431f542893f4a62c3d8604bb0">colorMenu</a> () const</td></tr>
<tr class="memdesc:afe7e665431f542893f4a62c3d8604bb0"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取colorMenu  <br /></td></tr>
<tr class="separator:afe7e665431f542893f4a62c3d8604bb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4b7687f8071f232092e9b4e3d8e957b" id="r_ac4b7687f8071f232092e9b4e3d8e957b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_s_a_color_menu.html">SAColorMenu</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac4b7687f8071f232092e9b4e3d8e957b">createColorMenu</a> ()</td></tr>
<tr class="memdesc:ac4b7687f8071f232092e9b4e3d8e957b"><td class="mdescLeft">&#160;</td><td class="mdescRight">建立标准的颜色菜单  <br /></td></tr>
<tr class="separator:ac4b7687f8071f232092e9b4e3d8e957b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:aaa120341f373fceea2607fd9ec6a3ff8" id="r_aaa120341f373fceea2607fd9ec6a3ff8"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aaa120341f373fceea2607fd9ec6a3ff8">paintNoneColor</a> (QPainter *p, const QRect &amp;colorRect)</td></tr>
<tr class="memdesc:aaa120341f373fceea2607fd9ec6a3ff8"><td class="mdescLeft">&#160;</td><td class="mdescRight">绘制无颜色表示  <br /></td></tr>
<tr class="separator:aaa120341f373fceea2607fd9ec6a3ff8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected 成员函数</h2></td></tr>
<tr class="memitem:a8981453b306262e33e00a80f417a7157" id="r_a8981453b306262e33e00a80f417a7157"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8981453b306262e33e00a80f417a7157">calcRect</a> (const QStyleOptionToolButton &amp;opt, QRect &amp;iconRect, QRect &amp;textRect, QRect &amp;colorRect)</td></tr>
<tr class="memdesc:a8981453b306262e33e00a80f417a7157"><td class="mdescLeft">&#160;</td><td class="mdescRight">计算各个基本组件的位置  <br /></td></tr>
<tr class="separator:a8981453b306262e33e00a80f417a7157"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fdbce8c0fbe64f958f873ab2bc209eb" id="r_a9fdbce8c0fbe64f958f873ab2bc209eb"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9fdbce8c0fbe64f958f873ab2bc209eb">paintButton</a> (QStylePainter *p, const QStyleOptionToolButton &amp;opt)</td></tr>
<tr class="memdesc:a9fdbce8c0fbe64f958f873ab2bc209eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">绘制按钮  <br /></td></tr>
<tr class="separator:a9fdbce8c0fbe64f958f873ab2bc209eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12822cf78cd460ddc8698be39573194c" id="r_a12822cf78cd460ddc8698be39573194c"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a12822cf78cd460ddc8698be39573194c">paintIcon</a> (QStylePainter *p, const QRect &amp;iconRect, const QStyleOptionToolButton &amp;opt)</td></tr>
<tr class="memdesc:a12822cf78cd460ddc8698be39573194c"><td class="mdescLeft">&#160;</td><td class="mdescRight">绘制icon  <br /></td></tr>
<tr class="separator:a12822cf78cd460ddc8698be39573194c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a749f1bcc5bc381588b9420e20e7b77eb" id="r_a749f1bcc5bc381588b9420e20e7b77eb"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a749f1bcc5bc381588b9420e20e7b77eb">paintText</a> (QStylePainter *p, const QRect &amp;textRect, const QStyleOptionToolButton &amp;opt)</td></tr>
<tr class="memdesc:a749f1bcc5bc381588b9420e20e7b77eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">绘制文本  <br /></td></tr>
<tr class="separator:a749f1bcc5bc381588b9420e20e7b77eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5da84b6582ec2e50a3945dcbccbec1d" id="r_ac5da84b6582ec2e50a3945dcbccbec1d"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac5da84b6582ec2e50a3945dcbccbec1d">paintColor</a> (QStylePainter *p, const QRect &amp;colorRect, const QColor &amp;<a class="el" href="#a22110441cd88842a1e79bf9ad87c5eb9">color</a>, const QStyleOptionToolButton &amp;opt)</td></tr>
<tr class="memdesc:ac5da84b6582ec2e50a3945dcbccbec1d"><td class="mdescLeft">&#160;</td><td class="mdescRight">绘制color  <br /></td></tr>
<tr class="separator:ac5da84b6582ec2e50a3945dcbccbec1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e2624a1db391f519c5b87cc74ce437f" id="r_a4e2624a1db391f519c5b87cc74ce437f"><td class="memItemLeft" align="right" valign="top"><a id="a4e2624a1db391f519c5b87cc74ce437f" name="a4e2624a1db391f519c5b87cc74ce437f"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>paintEvent</b> (QPaintEvent *e) Q_DECL_OVERRIDE</td></tr>
<tr class="separator:a4e2624a1db391f519c5b87cc74ce437f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb80fa7b8d1ce22cb2d7d2a6cdc1d8a6" id="r_aeb80fa7b8d1ce22cb2d7d2a6cdc1d8a6"><td class="memItemLeft" align="right" valign="top"><a id="aeb80fa7b8d1ce22cb2d7d2a6cdc1d8a6" name="aeb80fa7b8d1ce22cb2d7d2a6cdc1d8a6"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>resizeEvent</b> (QResizeEvent *e) Q_DECL_OVERRIDE</td></tr>
<tr class="separator:aeb80fa7b8d1ce22cb2d7d2a6cdc1d8a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5851cc39298cd34bda23838d8938c6e" id="r_ab5851cc39298cd34bda23838d8938c6e"><td class="memItemLeft" align="right" valign="top">virtual QSize&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab5851cc39298cd34bda23838d8938c6e">sizeHint</a> () const Q_DECL_OVERRIDE</td></tr>
<tr class="memdesc:ab5851cc39298cd34bda23838d8938c6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">sizeHint重载  <br /></td></tr>
<tr class="separator:ab5851cc39298cd34bda23838d8938c6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>这是一个只显示颜色的toolbutton </p>
<p>在ToolButtonIconOnly模式下，如果没有setIcon,则颜色占用所有区域，如下图所示</p>
<p>┌─────┐ │color│ └─────┘</p>
<p>如果在ToolButtonIconOnly模式下有图标，图标在上面显示，下面显示颜色，如下图所示</p>
<p>┌─────┐ │icon │ │color│ └─────┘</p>
<p>在ToolButtonTextBesideIcon，ToolButtonTextUnderIcon下，setIconSize 可以指定颜色的大小， 但只在ToolButtonTextBesideIcon，ToolButtonTextUnderIcon下有效</p>
<p>如果没有设置图标，也就是setIcon(QIcon()),iconSize作为颜色块的大小</p>
<p>┌─────────┐ │┌─┐ │ │└─┘ │ └─────────┘</p>
<p>如果有图标，颜色条会在图标下方，为图标高度的1/4 为图标宽度一致，如若超过控件的大小，会自动缩小体积 </p>
</div><h2 class="groupheader">成员枚举类型说明</h2>
<a id="a9e1b41f328cac2030a198fc4509fa344" name="a9e1b41f328cac2030a198fc4509fa344"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e1b41f328cac2030a198fc4509fa344">&#9670;&#160;</a></span>ColorToolButtonStyle</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="#a9e1b41f328cac2030a198fc4509fa344">SAColorToolButton::ColorToolButtonStyle</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>颜色按钮的内置样式 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>
<table class="fieldtable">
<tr><th colspan="2">枚举值</th></tr><tr><td class="fieldname"><a id="a9e1b41f328cac2030a198fc4509fa344a9e5a66a1fa852c94de022dc3ffab525a" name="a9e1b41f328cac2030a198fc4509fa344a9e5a66a1fa852c94de022dc3ffab525a"></a>WithColorMenu&#160;</td><td class="fielddoc"><p>默认会构建一个SAColorMenu </p>
</td></tr>
<tr><td class="fieldname"><a id="a9e1b41f328cac2030a198fc4509fa344ab08aec8a63a90bbf26096f84e4abf3fe" name="a9e1b41f328cac2030a198fc4509fa344ab08aec8a63a90bbf26096f84e4abf3fe"></a>NoColorMenu&#160;</td><td class="fielddoc"><p>没有ColorMenu </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a8981453b306262e33e00a80f417a7157" name="a8981453b306262e33e00a80f417a7157"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8981453b306262e33e00a80f417a7157">&#9670;&#160;</a></span>calcRect()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::calcRect </td>
          <td>(</td>
          <td class="paramtype">const QStyleOptionToolButton &amp;</td>          <td class="paramname"><span class="paramname"><em>opt</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QRect &amp;</td>          <td class="paramname"><span class="paramname"><em>iconRect</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QRect &amp;</td>          <td class="paramname"><span class="paramname"><em>textRect</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QRect &amp;</td>          <td class="paramname"><span class="paramname"><em>colorRect</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>计算各个基本组件的位置 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">opt</td><td></td></tr>
    <tr><td class="paramname">iconRect</td><td>图标区域 </td></tr>
    <tr><td class="paramname">textRect</td><td>文本区域 </td></tr>
    <tr><td class="paramname">colorRect</td><td>颜色区域 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a22110441cd88842a1e79bf9ad87c5eb9" name="a22110441cd88842a1e79bf9ad87c5eb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22110441cd88842a1e79bf9ad87c5eb9">&#9670;&#160;</a></span>color()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QColor SAColorToolButton::color </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取颜色 </p>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="abcc38455a0be7f57aa389e6f5e388cf2" name="abcc38455a0be7f57aa389e6f5e388cf2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abcc38455a0be7f57aa389e6f5e388cf2">&#9670;&#160;</a></span>colorChanged</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::colorChanged </td>
          <td>(</td>
          <td class="paramtype">const QColor &amp;</td>          <td class="paramname"><span class="paramname"><em>color</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">signal</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>颜色改变信号 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">color</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a95ffb60a5732b1bc58a7080c951fcf19" name="a95ffb60a5732b1bc58a7080c951fcf19"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a95ffb60a5732b1bc58a7080c951fcf19">&#9670;&#160;</a></span>colorClicked</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::colorClicked </td>
          <td>(</td>
          <td class="paramtype">const QColor &amp;</td>          <td class="paramname"><span class="paramname"><em>color</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool</td>          <td class="paramname"><span class="paramname"><em>checked</em><span class="paramdefsep"> = </span><span class="paramdefval">false</span></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">signal</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>颜色被点击的响应 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">color</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="afe7e665431f542893f4a62c3d8604bb0" name="afe7e665431f542893f4a62c3d8604bb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe7e665431f542893f4a62c3d8604bb0">&#9670;&#160;</a></span>colorMenu()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_s_a_color_menu.html">SAColorMenu</a> * SAColorToolButton::colorMenu </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取colorMenu </p>
<dl class="section note"><dt>注解</dt><dd>注意，这个函数很有可能会返回nullptr，如果ColorToolButtonStyle设置为NoColorMenu或者自己设置了菜单，此函数返回nullptr </dd></dl>
<dl class="section return"><dt>返回</dt><dd>SAColorMenu指针，如果没有，返回nullptr </dd></dl>

</div>
</div>
<a id="aeb0cf85ca732aa9b2920d463ab6ac943" name="aeb0cf85ca732aa9b2920d463ab6ac943"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb0cf85ca732aa9b2920d463ab6ac943">&#9670;&#160;</a></span>colorToolButtonStyle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="#a9e1b41f328cac2030a198fc4509fa344">SAColorToolButton::ColorToolButtonStyle</a> SAColorToolButton::colorToolButtonStyle </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>颜色按钮的样式 </p>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="ac4b7687f8071f232092e9b4e3d8e957b" name="ac4b7687f8071f232092e9b4e3d8e957b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4b7687f8071f232092e9b4e3d8e957b">&#9670;&#160;</a></span>createColorMenu()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_s_a_color_menu.html">SAColorMenu</a> * SAColorToolButton::createColorMenu </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>建立标准的颜色菜单 </p>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="a9fdbce8c0fbe64f958f873ab2bc209eb" name="a9fdbce8c0fbe64f958f873ab2bc209eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fdbce8c0fbe64f958f873ab2bc209eb">&#9670;&#160;</a></span>paintButton()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::paintButton </td>
          <td>(</td>
          <td class="paramtype">QStylePainter *</td>          <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QStyleOptionToolButton &amp;</td>          <td class="paramname"><span class="paramname"><em>opt</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>绘制按钮 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td></td></tr>
    <tr><td class="paramname">opt</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ac5da84b6582ec2e50a3945dcbccbec1d" name="ac5da84b6582ec2e50a3945dcbccbec1d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5da84b6582ec2e50a3945dcbccbec1d">&#9670;&#160;</a></span>paintColor()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::paintColor </td>
          <td>(</td>
          <td class="paramtype">QStylePainter *</td>          <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QRect &amp;</td>          <td class="paramname"><span class="paramname"><em>colorRect</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QColor &amp;</td>          <td class="paramname"><span class="paramname"><em>color</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QStyleOptionToolButton &amp;</td>          <td class="paramname"><span class="paramname"><em>opt</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>绘制color </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td></td></tr>
    <tr><td class="paramname">iconRect</td><td></td></tr>
    <tr><td class="paramname">opt</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a12822cf78cd460ddc8698be39573194c" name="a12822cf78cd460ddc8698be39573194c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a12822cf78cd460ddc8698be39573194c">&#9670;&#160;</a></span>paintIcon()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::paintIcon </td>
          <td>(</td>
          <td class="paramtype">QStylePainter *</td>          <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QRect &amp;</td>          <td class="paramname"><span class="paramname"><em>iconRect</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QStyleOptionToolButton &amp;</td>          <td class="paramname"><span class="paramname"><em>opt</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>绘制icon </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td></td></tr>
    <tr><td class="paramname">iconRect</td><td></td></tr>
    <tr><td class="paramname">opt</td><td>icon信息从QStyleOptionToolButton获取 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aaa120341f373fceea2607fd9ec6a3ff8" name="aaa120341f373fceea2607fd9ec6a3ff8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa120341f373fceea2607fd9ec6a3ff8">&#9670;&#160;</a></span>paintNoneColor()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::paintNoneColor </td>
          <td>(</td>
          <td class="paramtype">QPainter *</td>          <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QRect &amp;</td>          <td class="paramname"><span class="paramname"><em>colorRect</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>绘制无颜色表示 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td></td></tr>
    <tr><td class="paramname">colorRect</td><td>绘制的区域 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a749f1bcc5bc381588b9420e20e7b77eb" name="a749f1bcc5bc381588b9420e20e7b77eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a749f1bcc5bc381588b9420e20e7b77eb">&#9670;&#160;</a></span>paintText()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::paintText </td>
          <td>(</td>
          <td class="paramtype">QStylePainter *</td>          <td class="paramname"><span class="paramname"><em>p</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QRect &amp;</td>          <td class="paramname"><span class="paramname"><em>textRect</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QStyleOptionToolButton &amp;</td>          <td class="paramname"><span class="paramname"><em>opt</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>绘制文本 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">p</td><td></td></tr>
    <tr><td class="paramname">textRect</td><td></td></tr>
    <tr><td class="paramname">opt</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af25b39793bb7bab82cd85a44a5da4971" name="af25b39793bb7bab82cd85a44a5da4971"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af25b39793bb7bab82cd85a44a5da4971">&#9670;&#160;</a></span>setColor</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::setColor </td>
          <td>(</td>
          <td class="paramtype">const QColor &amp;</td>          <td class="paramname"><span class="paramname"><em>c</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置颜色 </p>
<dl class="section note"><dt>注解</dt><dd>会发射</dd></dl>
<dl class="section see"><dt>参见</dt><dd><a class="el" href="#abcc38455a0be7f57aa389e6f5e388cf2" title="颜色改变信号">colorChanged</a> 信号 </dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">c</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3f729c5a41bf79744633261745b11533" name="a3f729c5a41bf79744633261745b11533"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f729c5a41bf79744633261745b11533">&#9670;&#160;</a></span>setColorToolButtonStyle()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::setColorToolButtonStyle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="#a9e1b41f328cac2030a198fc4509fa344">ColorToolButtonStyle</a></td>          <td class="paramname"><span class="paramname"><em>s</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置颜色按钮的样式 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6e9052dc90f01e96ea99416f8143c7f6" name="a6e9052dc90f01e96ea99416f8143c7f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e9052dc90f01e96ea99416f8143c7f6">&#9670;&#160;</a></span>setMargins()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SAColorToolButton::setMargins </td>
          <td>(</td>
          <td class="paramtype">const QMargins &amp;</td>          <td class="paramname"><span class="paramname"><em>mg</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置Margins </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">mg</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ab5851cc39298cd34bda23838d8938c6e" name="ab5851cc39298cd34bda23838d8938c6e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5851cc39298cd34bda23838d8938c6e">&#9670;&#160;</a></span>sizeHint()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QSize SAColorToolButton::sizeHint </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>sizeHint重载 </p>
<dl class="section return"><dt>返回</dt><dd></dd></dl>
<p>Qt6.4 取消了QApplication::globalStrut</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>C:/src/Qt/SARibbon/src/SARibbonBar/colorWidgets/<a class="el" href="_s_a_color_tool_button_8h_source.html">SAColorToolButton.h</a></li>
<li>C:/src/Qt/SARibbon/src/SARibbonBar/colorWidgets/<b>SAColorToolButton.cpp</b></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_s_a_color_tool_button.html">SAColorToolButton</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
